package org.hegang.design.second.absfactory;

public class ColorFactory extends AbstractFactory {

    @Override
    public Shape getShape(String shape) {
        return null;
    }

    @Override
    public Color getColor(String color) {
        if ("Red".equalsIgnoreCase(color)) {
            return new Red();
        } else if ("Blue".equalsIgnoreCase(color)) {
            return new Blue();
        } else {
            throw new IllegalArgumentException("参数异常");
        }
    }
}
